package forums.dao;

import java.util.List;

import org.springframework.stereotype.Repository;
import org.springframework.util.Assert;

import forums.model.Forum;

/*
 * Author       :       Willie Wheeler and John Wheeler
 * Book         :       'Spring In Practice' [Book written by Willie Wheeler and John Wheeler]
 */

@Repository
public class DummyForumDao implements ForumDao {
	private ObjectFactory factory = ObjectFactory.instance();
	
	public List<Forum> readForums() {
		return factory.createForums();
	}

	public Forum readForum(Long id) {
		Assert.notNull(id, "id required");
		return factory.createForum(id);
	}
}
